import styles from './teachers.less';
import { NavLink , getLocale, setLocale, useIntl } from 'umi'
// import { NavLink, getLocale, setLocale, useIntl } from 'umi'
import { Layout } from 'antd';
import { Menu, Dropdown, Badge, Avatar, Divider, Tooltip, Popover, Select } from 'antd';
import { BellOutlined } from '@ant-design/icons';

import useStore from '@/context/useStore';
// import Breadcrumb from '@/components/breadCrumb.tsx';
import { observer } from 'mobx-react-lite';
import { DownOutlined } from '@ant-design/icons';
import React, { useEffect } from 'react';
let { Header, Footer, Content } = Layout;

//面试
const interviewMenu = <Menu>
    <Menu.Item key="1">
        <NavLink to="/students/interviewManage">面试记录</NavLink>
    </Menu.Item>
    <Menu.Item key="2">
        <NavLink to="/students/myInterviewManage">面试记录管理</NavLink>
    </Menu.Item>
    <Menu.Item key="3">
        <NavLink to="/students/rankList">面试排行榜</NavLink>
    </Menu.Item>
</Menu>
//问答
const questionMenu = <Menu>
    <Menu.Item key="1">
        <NavLink to="/students/projectAnswer_sub">问答列表</NavLink>
    </Menu.Item>
    <Menu.Item key="2">
        <NavLink to="/students/myQuestionAnswer">问答管理</NavLink>
    </Menu.Item>
</Menu>

// 提示气泡
const Tip_text = <h1>代办提示</h1>;
const Tip_content = (
    <div className={styles.TipsPage}>
        <p>
            内容
        </p>

        <div className={styles.hr}></div>

        <NavLink to='/students/needHandle'> 
                <p>
                查看详情
                </p>
            </NavLink>
    </div>
);

const TeacherLayout: React.FC = (props) => {
    const enLanguage: { [key: string]: string } = {
        'en': 'en-US',
        'en-US': 'en-US',
    }
        const { global } = useStore();
        const intl = useIntl();

        let { login , getInfo} = useStore();
        useEffect(() => {
            getInfo.getInFo();
        }, [])

    // 头像气泡
    const Top_content = (
        <div className={styles.MyPageDown}>
            <NavLink to='/students/studentsPersonCenter'> 
                <p>
                个人中心
                </p>
            </NavLink>
            <NavLink to='/students/needHandle'> 
                <p>
                我的代办
                </p>
            </NavLink>
            <NavLink to='/login'> 
                <p>
                    退出
                </p>
            </NavLink>
        </div>
    );

    return <Layout>
        <Header className={styles.header}>
            <div className={styles.box}>
                <div>
                    <img src="http://111.203.59.61:8060/static/img/w_bw.172a76e5.png" />
                    <NavLink to='/students/postSkill' className={styles.link}>{intl.formatMessage({
                        id: 'header.station',
                    })}</NavLink>
                    <NavLink to='/students/projectKu' className={styles.link}>{intl.formatMessage({
                        id: 'header.project',
                    })}</NavLink>
                    {/* <Dropdown overlay={practiceMenu} className={styles.link}>
                        <a className="ant-dropdown-link" onClick={e => e.preventDefault()}>{intl.formatMessage({id: 'header.practical',})}<DownOutlined />
                        </a>
                    </Dropdown> */}

                    <NavLink to='/students/myProject' className={styles.link}>{intl.formatMessage({
                        id: 'header.myProject',
                    })}</NavLink>

                    <Dropdown overlay={interviewMenu} className={styles.link}>
                        <a className="ant-dropdown-link" onClick={e => e.preventDefault()}>{intl.formatMessage({id: 'header.interview',})}
                            <DownOutlined />
                        </a>
                    </Dropdown>
                    <Dropdown overlay={questionMenu} className={styles.link}>
                        <a className="ant-dropdown-link" onClick={e => e.preventDefault()}>{intl.formatMessage({id: 'header.answer',})}
                            <DownOutlined />
                        </a>
                    </Dropdown>
                    <Select value={getLocale()} onChange={value => setLocale(value,false)}>
                        <Select.Option value="en-US">English</Select.Option>
                        <Select.Option value="zh-CN">中文</Select.Option>
                        <Select.Option value="ko-KR">한국어</Select.Option>
                        <Select.Option value="ja-JP">日本語</Select.Option>
                    </Select>
                </div>

                <div>
                    <div className={styles.icon}>
                        <Popover placement="bottomRight" title={Tip_text} content={Tip_content} trigger="click">
                            <Badge count={5}>
                                <BellOutlined className={styles.hint} />
                            </Badge>
                        </Popover>

                    </div>
                    <div className={styles.head_Icon}>
                        <Popover placement="bottomLeft" content={Top_content} trigger="click">
                            <Avatar style={{ backgroundColor: "#fff" }} size={35} src={`http://111.203.59.61:8060${getInfo.MyInfo.avatar}`} />
                        </Popover>
                    </div>
                    <div className={styles.nickName}>
                        {
                            getInfo.MyInfo.nickName
                        }
                    </div>
                </div>
            </div>
        </Header>

        {/* <Breadcrumb /> */}

        <Content>{props.children}</Content>
        <Footer className={styles.footer}>
            <div className={styles.bw_bottom}>
                <div className={styles.b_b_detail}>
                    <div className={styles.b_b_left}>
                        <div className={styles.bw_img}><img src="http://111.203.59.61:8060/static/img/bottom_logo.c8aa9859.png" alt="" /></div>
                        <div className={styles.b_w_tel}>400-008-0987</div></div>
                    <div className={styles.b_b_middle}>
                        <div className={styles.middle_one}>
                            <div className={styles.middle_title}>走进八维</div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/about.html">集团概况</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/news/index.html">八维动态</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/lead.html">领导关怀</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/honour.html">企业荣誉</a></div>
                        </div>
                        <div className={styles.middle_two}>
                            <div className={styles.middle_title}>八维文化</div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/culture.html">八维理念</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/spirit.html">八维精神</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/dak.html">文化驿站</a></div></div>
                        <div className={styles.middle_three}><div className={styles.middle_title}>社会责任</div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/duty/public.html">社会公益</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/duty/great.html">大善之举</a></div></div>
                        <div className={styles.middle_four}>
                            <div className={styles.middle_title}>联系我们</div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/partners.html">业务合作</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/sign_up.html">咨询报名</a></div>
                            <div className={styles.href_a}><a href="http://bwie.cn/bwie/concact.html">联系方式</a></div>
                        </div>
                    </div>
                    <div className={styles.b_b_right}>
                        <img src="http://111.203.59.61:8060/static/img/wechat.e60a83ec.png" alt="" />
                        <div className={styles.wechat_text}>八维微信公众号</div>
                    </div></div>
                <div className={styles.b_b_sign}>京公网安备 11010802031438号 © Copyright 2020. 八维教育版权所有 | 京ICP备12008262号-12</div>
            </div>
        </Footer>
    </Layout>
}
export default observer(TeacherLayout)